package com.aspose.cells;

public class ColorFilter {
   private FilterColumn a;
   private boolean b = true;
   private int c;
   private zakp d = new zakp(false);

   ColorFilter(FilterColumn filter) {
      this.a = filter;
   }

   boolean a(Cell var1, int var2, int var3) {
      Worksheet var4 = this.a.c().a().a();
      WorksheetCollection var5 = var4.c();
      if (this.c >= 0 && this.c <= var5.getDxfs().getCount()) {
         Style var6 = var5.getDxfs().get(this.c);
         Style var7 = null;
         int var8;
         if (var1 != null) {
            var8 = var1.r();
         } else {
            var8 = var4.getCells().c(var2, var3);
         }

         if (var8 == -1) {
            var7 = var5.D();
         } else {
            var7 = var5.f(var8);
         }

         if (!this.b) {
            if (var6.b.a()) {
               return (var7.getFont().getColor().toArgb() & 16777215) == 0;
            } else {
               return var7.getFont().b.a(var6.b, var5.n(), var5.n());
            }
         } else {
            switch(var6.getPattern()) {
            case 0:
               return var7.getPattern() == 0;
            case 1:
               return var7.getPattern() == 1 && var7.b.a(var6.b, var5.n(), var5.n());
            default:
               return var7.getPattern() == var6.getPattern() && var7.b.a(var6.b, var5.n(), var5.n()) && var7.a.a(var6.a, var5.n(), var5.n());
            }
         }
      } else {
         return true;
      }
   }

   void a(ColorFilter var1, boolean var2) {
      this.b = var1.b;
      this.c = var1.c;
   }

   public boolean getFilterByFillColor() {
      return this.b;
   }

   public void setFilterByFillColor(boolean value) {
      this.b = value;
   }

   int a() {
      return this.c;
   }

   void a(int var1) {
      this.c = var1;
   }

   public Color getColor(WorksheetCollection sheets) {
      return this.d.b(sheets.n());
   }
}
